home *** CD-ROM | disk | FTP | other *** search
- public _strlen
- ;∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
- ; Get length of ASCIIZ string
- ; In:
- ; EDX -> string
- ; Out:
- ; EAX - length
- ;∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
- _strlen:
- push ecx
- push edi
- mov edi,edx
- mov ecx,-1
- xor al,al
- repnz scasb
- mov eax,-2
- sub eax,ecx
- pop edi
- pop ecx
- ret
-
-